var t = require("../../../../@babel/runtime/helpers/typeof"), a = getApp();

Page({
    data: {
        language: "",
        activeName: "first",
        recordsList: [],
        dataInfo: {},
        love_name: "",
        isLoadMore: !0,
        page: 1,
        total_page: 0
    },
    onLoad: function(t) {
        this.getData();
    },
    checkrouter: function() {
        try {
            var a = function() {
                for (var t = wx.getStorageSync("yz_basic_info"), a = t.popularize_page.mini.vue_route, e = 0; e < a.length; e++) if ("lovePerformance" == a[e]) return console.log(t.popularize_page.mini.mini_url + "跳转的路径"), 
                wx.showToast({
                    title: "未开启推广权限",
                    duration: 1e3,
                    icon: "none",
                    success: function() {
                        setTimeout(function() {
                            wx.redirectTo({
                                url: t.popularize_page.mini.mini_url
                            });
                        }, 1e3);
                    }
                }), {
                    v: void 0
                };
            }();
            if ("object" === t(a)) return a.v;
        } catch (t) {
            console.log(t);
        }
    },
    onReady: function() {
        var t = wx.getStorageSync("langIndex");
        this.setData({
            language: t.en
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        this.data.isLoadMore ? this.getMoreData() : console.log("没有更多了");
    },
    onShareAppMessage: function() {},
    getData: function() {
        var t = this, e = a.getNetAddresss("plugin.love-team.frontend.log.index");
        e += "&page=1", a._getNetWork({
            url: e,
            success: function(a) {
                var e = a.data;
                1 == e.result ? (t.setData({
                    dataInfo: e.data,
                    love_name: e.data.love_name,
                    isLoadMore: !0,
                    total_page: e.data.list.last_page,
                    recordsList: e.data.list.data
                }), wx.setNavigationBarTitle({
                    title: t.data.love_name + "团队奖励记录"
                })) : wx.showToast({
                    title: e.msg,
                    icon: "none"
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    getMoreData: function() {
        var t = this;
        if (this.setData({
            isLoadMore: !1
        }), !(this.data.page >= this.data.total_page)) {
            this.setData({
                page: this.data.page + 1
            });
            var e = a.getNetAddresss("plugin.love-team.frontend.log.index");
            e += "&page=" + this.data.page, a._getNetWork({
                url: e,
                success: function(a) {
                    var e = a.data;
                    1 == e.result ? t.setData({
                        isLoadMore: !0,
                        recordsList: t.data.recordsList.concat(e.data.list.data)
                    }) : (wx.showToast({
                        title: e.msg,
                        icon: "none"
                    }), t.setData({
                        page: t.data.page - 1,
                        isLoadMore: !1
                    }));
                },
                fail: function(t) {
                    console.log(t);
                }
            });
        }
    }
});